[tizen_rpc_port] Update RpcPort to support TIDL protocol version 2#1070
Conversation
Add low level Parcel primitives to support the Dart protocol version 2 generator under packages/tizen_rpc_port. Implement the dataSize, reserve, and reader getter/setter properties in the Parcel class using Dart FFI to map them to the native C APIs: - rpc_port_parcel_get_reader - rpc_port_parcel_set_reader - rpc_port_parcel_get_data_size - rpc_port_parcel_set_data_size - rpc_port_parcel_reserve Co-Authored-By: Gemini CLI <gemini-cli@google.com> Signed-off-by: jh9216.park <jh9216.park@samsung.com>
There was a problem hiding this comment.
Code Review
This pull request adds properties and methods to the Parcel class in packages/tizen_rpc_port/lib/src/parcel.dart to manage reader position, data size, and capacity reservation, along with their corresponding FFI bindings. Feedback suggests adding non-negative validation checks (RangeError.checkNotNegative) to the reader and dataSize setters and the reserve method to prevent passing negative values to the native API. Additionally, it is recommended to use rpc_port_parcel_h instead of Pointer<Void> in the FFI signatures to improve type safety.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
JSUYA
left a comment
There was a problem hiding this comment.
Please check gemini's review comments. If you think they are invalid, please resolve them.
And
Please modify the format using Dart Formatter.
https://github.com/flutter-tizen/plugins/actions/runs/29460673863/job/87506437916?pr=1070
2026-07-16T00:35:55.7848891Z Running command: "dart format example/client/integration_test/tizen_rpc_port_test.dart example/client/lib/main.dart example/client/lib/message_client.dart example/client/test_driver/integration_test.dart example/server/integration_test/tizen_rpc_port_test.dart example/server/lib/main.dart example/server/lib/message_server.dart example/server/test_driver/integration_test.dart lib/src/parcel.dart lib/src/port.dart lib/src/proxy_base.dart lib/src/stub_base.dart lib/tizen_rpc_port.dart" in /home/runner/work/plugins/plugins/packages/tizen_rpc_port
| } | ||
| } | ||
|
|
||
| final DynamicLibrary _libRpcPort = DynamicLibrary.open('librpc-port.so.1'); |
There was a problem hiding this comment.
Do these APIs have a dependency on the Tizen version? Are they only used in Tizen 11?
There was a problem hiding this comment.
Yes, It is dependent on tizen version. Since Tizen 10
There was a problem hiding this comment.
Are these APIs public open ACR APIs?
If this API is changed in librpc-port.so in Tizen 11.0 or 10.1, platform compatibility cannot be guaranteed to users.
At the very least, there needs to be a way to verify that these APIs are managed.
There was a problem hiding this comment.
It is internal API but It will not be changed to support backward compatibility.
The native APIs is already working in many apps using TIDL.
There was a problem hiding this comment.
I made sample app to test action. Working well. (https://github.sec.samsung.net/jh9216-park/ActionSampleAppDart)
Please review and merge it ASAP
There was a problem hiding this comment.
This API is only compatible with version 10.0, and there are absolutely no guards prepared for cases where it is used with other APIs.
Furthermore, there are no related integration_tests, and there are no modifications whatsoever to the README, CHANGELOG, or pubspec.yaml related to the tizen_rpc_port deployment.
flutter-tizen includes plugin code in the app packaging. It may also be deployed with the minimum supported version set (general guideline).
Therefore, version compatibility should be maintained whenever possible, and measures must be taken to prevent crashes when a non-functional API is called.
Please add relevant guards and ensure that appropriate exception messages are handled in the event of an unsupported API.
There was a problem hiding this comment.
please see [tizen_rpc_port] Guard Parcel APIs for compatibility commit
There was a problem hiding this comment.
Please check analyze and integration_test CI fails.
There was a problem hiding this comment.
Fixed check analyze issue. Please run CI test. I don't have permission
Add RangeError.checkNotNegative checks to Parcel setters and methods to prevent negative values from being passed to native unsigned APIs. Use rpc_port_parcel_h handle type instead of Pointer<Void> in the FFI signatures to improve type safety and consistency. Run dart format on all specified package files to adhere to formatting standards. Co-Authored-By: Gemini CLI <gemini-cli@google.com> Signed-off-by: jh9216.park <jh9216.park@samsung.com>
Run './tools/tools_runner.sh format' to properly format the package files according to the tizen_rpc_port package's language standards. This corrects indentation and layout in: - message_client.dart - message_server.dart - parcel.dart - proxy_base.dart - stub_base.dart Co-Authored-By: Gemini CLI <gemini-cli@google.com> Signed-off-by: jh9216.park <jh9216.park@samsung.com>
Safely load librpc-port.so.1 and its symbols dynamically to prevent crashes on older Tizen versions. Throw an UnsupportedError when these unsupported APIs (reader, dataSize, reserve) are invoked. Add integration tests to verify the compatibility behavior. Update the README with requirements, bump version to 0.1.7, and update CHANGELOG. Co-Authored-By: Gemini CLI <gemini-cli@google.com> Signed-off-by: jh9216.park <jh9216.park@samsung.com>
Run dart format to fix formatting violations in parcel.dart. This re-wraps the FFI lookup lines in _ensureFunctionsLoaded. Co-Authored-By: Gemini CLI <gemini-cli@google.com> Signed-off-by: jh9216.park <jh9216.park@samsung.com>
Add low level Parcel primitives to support the TIDL protocol version 2 Dart generator under packages/tizen_rpc_port.
Implement the dataSize, reserve, and reader getter/setter properties in the Parcel class using Dart FFI to map them to the native C APIs: